package com.jiantong.user.impl.dao;

import com.jiantong.user.model.RoleModlue;
import io.terminus.common.mysql.dao.MyBatisDao;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by ThinkPad on 2017/8/10.
 */
@Repository
public class RoleModlueDao extends MyBatisDao<RoleModlue> {

    /**
     * 通过角色ID查询该角色所有模块的id
     * @param roleId
     * @return
     */
    public List<Long> selectModuleByRoleId(Long roleId){

     return  getSqlSession().selectList(this.sqlId("selectModuleByRoleId"),roleId);
    }

    public Boolean delByModuleIdAndRoleId(Map criteria){
        return getSqlSession().delete(sqlId("delByModuleIdAndRoleId"),criteria)>0;
    }

}
